From 5b6313f16f508882a0ea67716b7dbaa1c6967f04 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 30 Jun 2025 08:28:13 +0000
Subject: (대표님) 20250630 16시 - 유저 도메인별 라우터 분리와 보안성검토 대응
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../tech-vendors/[id]/info/layout.tsx              | 82 ++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 app/[lng]/engineering/(engineering)/tech-vendors/[id]/info/layout.tsx

(limited to 'app/[lng]/engineering/(engineering)/tech-vendors/[id]/info/layout.tsx')

diff --git a/app/[lng]/engineering/(engineering)/tech-vendors/[id]/info/layout.tsx b/app/[lng]/engineering/(engineering)/tech-vendors/[id]/info/layout.tsx
new file mode 100644
index 00000000..7c389720
--- /dev/null
+++ b/app/[lng]/engineering/(engineering)/tech-vendors/[id]/info/layout.tsx
@@ -0,0 +1,82 @@
+import { Metadata } from "next"
+
+import { Separator } from "@/components/ui/separator"
+import { SidebarNav } from "@/components/layout/sidebar-nav"
+import { findTechVendorById } from "@/lib/tech-vendors/service"
+import { TechVendor } from "@/db/schema/techVendors"
+import { Button } from "@/components/ui/button"
+import { ArrowLeft } from "lucide-react"
+import Link from "next/link"
+export const metadata: Metadata = {
+  title: "Tech Vendor Detail",
+}
+
+export default async function SettingsLayout({
+  children,
+  params,
+}: {
+  children: React.ReactNode
+  params: { lng: string , id: string}
+}) {
+
+  // 1) URL 파라미터에서 id 추출, Number로 변환
+  const resolvedParams = await params
+  const lng = resolvedParams.lng
+  const id = resolvedParams.id
+
+  const idAsNumber = Number(id)
+  // 2) DB에서 해당 협력업체 정보 조회
+  const vendor: TechVendor | null = await findTechVendorById(idAsNumber)
+
+  // 3) 사이드바 메뉴
+  const sidebarNavItems = [
+    {
+      title: "연락처",
+      href: `/${lng}/evcp/tech-vendors/${id}/info`,
+    },
+    // {
+    //   title: "자재 리스트",
+    //   href: `/${lng}/evcp/tech-vendors/${id}/info/items`,
+    // },
+    // {
+    //   title: "견적 히스토리",
+    //   href: `/${lng}/evcp/tech-vendors/${id}/info/rfq-history`,
+    // },
+  ]
+
+  return (
+    <>
+      <div className="container py-6">
+        <section className="overflow-hidden rounded-[0.5rem] border bg-background shadow">
+          <div className="hidden space-y-6 p-10 pb-16 md:block">
+            {/* RFQ 목록으로 돌아가는 링크 추가 */}
+            <div className="flex items-center justify-end mb-4">
+              <Link href={`/${lng}/evcp/tech-vendors`} passHref>
+                <Button variant="ghost" className="flex items-center text-primary hover:text-primary/80 transition-colors p-0 h-auto">
+                  <ArrowLeft className="mr-1 h-4 w-4" />
+                  <span>기술영업 벤더 목록으로 돌아가기</span>
+                </Button>
+              </Link>
+            </div>
+            <div className="space-y-0.5">
+              {/* 4) 협력업체 정보가 있으면 코드 + 이름 + "상세 정보" 표기 */}
+              <h2 className="text-2xl font-bold tracking-tight">
+                {vendor
+                  ? `${vendor.vendorCode ?? ""} - ${vendor.vendorName} 상세 정보`
+                  : "Loading Vendor..."}
+              </h2>
+              <p className="text-muted-foreground">기술영업 벤더 관련 상세사항을 확인하세요.</p>
+            </div>
+            <Separator className="my-6" />
+            <div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0">
+              <aside className="-mx-4 lg:w-1/5">
+                <SidebarNav items={sidebarNavItems} />
+              </aside>
+              <div className="flex-1">{children}</div>
+            </div>
+          </div>
+        </section>
+      </div>
+    </>
+  )
+}
\ No newline at end of file
-- 
cgit v1.2.3

